import React, { Suspense } from "react"
import ReactDOM from "react-dom/client"
import { HashRouter } from "react-router-dom"

import App from "@/App"
import "normalize.css"
import "antd/dist/antd.less"
import "./assets/css/index.less"
import { Provider } from "react-redux"
import store from "./store"
import { ThemeProvider } from "styled-components"
import theme from "./assets/theme"
// @ => src: webpack
// 问题：react脚手架隐藏webpack
// 解决一：npm run eject
// 解决二：craco => create-react-app config

const root = ReactDOM.createRoot(document.getElementById("root"))
root.render(
    // <React.StrictMode>
    <Provider store={store}>
        <Suspense fallback={<div>loading...</div>}>
            <HashRouter>
                <ThemeProvider theme={theme}>
                    <App />
                </ThemeProvider>
            </HashRouter>
        </Suspense>
    </Provider>
    // </React.StrictMode>
)
